<template>
	<view class="flex align-center p-2 border-bottom border-light-secondary animated fast fadeIn" hover-class="bg-light" @click="open">
		<image :src="item.avatar" style="width: 80rpx;height: 80rpx;" mode="aspectFill"></image>
		<view class="flex flex-column flex-1 ml-1">
			<view class="flex w-100 justify-between align-center">
				<view class="font-md">{{item.username}}</view>
				<view class="font-sm text-secondary">{{item.update_time|formateTime}}</view>
			</view>
			<view class="flex align-center justify-between">
				<text class="text-secondary text-ellipsis" style="max-width: 450rpx;">{{item.data}}</text>
				<!-- 角标显示 -->
				<uniBadge :text="item.noread" type="error"></uniBadge>
			</view>
		</view>
	</view>
</template>

<script>
	// 引入角标
	import uniBadge from '@/components/uni-ui/uni-badge/uni-badge.vue';
	import $T from '@/common/time.js';
	export default {
		components:{uniBadge},
		props:{
			item:Object,
			index:Number
		},
		filters: {
			formateTime(value) {
				return $T.gettime(value)
			}
		},
		methods:{
			open() {
				uni.navigateTo({
					url:'../../pages/userChat/userChat',
					success: res => {},fail: () => {},complete: () => {}
				})
			}
		}
	}
</script>

<style>
</style>
